//
//  EPMMainTabBar.m
//  myXianfeng
//
//  Created by 马继鵬 on 17/4/26.
//  Copyright © 2017年 EPM. All rights reserved.
//

#import "EPMMainTabBar.h"

@implementation EPMMainTabBar

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/



- (void)layoutSubviews{
    [super  layoutSubviews];
 
    for (UIView* subView in self.subviews)
    {
        if ( [subView isKindOfClass:NSClassFromString(@"UITabBarButton")])
        {
            UIControl* control = (UIControl*)subView;
            
            [control addTarget:self action:@selector(scaleItem:) forControlEvents:UIControlEventTouchUpInside];
                   
        }
    }
}

- (void)scaleItem:(UIControl*)sender{
    //    CGPoint center = sender.center;
    [UIView animateWithDuration:0.2 animations:^{
        sender.transform = CGAffineTransformMakeScale(1.2, 1.2);
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.2 animations:^{
            sender.transform = CGAffineTransformIdentity;
        }];
    }];
}



@end
